/*
 * Created: 2022-08-27 10:30:48
 * Author : 涛涛涛
 */

import React, { FC } from 'react';
import { View, Text } from '@tarojs/components';
import { styled } from 'linaria/react';
import { useClassName } from '@/utils/index';
export interface IProps extends ICompProps {
    head: React.ReactNode;
    body: React.ReactNode;
}
Wireframe.defaultProps = {} as Partial<IProps>;
function Wireframe(props: IProps) {
    const { className, style, head, body } = props;
    const localClassName = useClassName('Wireframe', className);
    return (
        <RootView className={localClassName} style={style}>
            {head}
            {/* 有头有身体才有这个分隔线. */}
            {head && body && <View className="Wireframe-divider"></View>}
            {body}
        </RootView>
    );
}
export default React.memo(Wireframe as FC<IProps>);
const RootView = styled(View)`
    &.Wireframe {
        margin: auto;
        width: 680px;
        border: 1px solid #ccc;
        border-radius: 20px;
        .Wireframe-divider {
            border: 1px solid #ccc;
        }
    }
`;
